import { TineConfigure, transformCssModuleName } from '@tencent/rollup-config-tine';

export default {
    libType: 'original',
    entry: './src/index.ts',
    output: {
        exports: 'named',
        format: 'esm',
        file: './dist/index.js'
    },
    scssModule: {
        filename: 'index[extname]',
        sass: {
            api: 'modern'
        },
        modules: {
            naming: 'camelCase',
            generateScopedName: transformCssModuleName('k')
        }
    },
    external: [/^react/, /^react-dom/, /^@material/, /^@babel/, /^@tarojs\/\w+$/],
    build: {
        babelType: 'react-lib',
        target: process.env.NODE_ENV === 'production' ? 'es5' : 'es6',
        isMinify: process.env.NODE_ENV === 'production'
    },
    declaration: {
        output: {
            file: './dist/index.d.ts'
        }
    }
} satisfies TineConfigure;
